#include "comm.h"
#include<sys/types.h>
#include<sys/ipc.h>
#include<sys/shm.h>
#include<unistd.h>
int main()
{
	key_t k = ftok(PATH_NAME,PROJ_ID);
	if(k < 0)
	{
		perror("ftok");
		return 1;
	}
	printf("%x\n",k);
	int shmid = shmget(k,SIZE,IPC_CREAT);
	if(shmid < 0)
	{
		perror("shmget");
		return 2;
	}
	char* start = (char*)shmat(shmid,NULL,0);

	char c = 'A';
	while(c <= 'Z')
	{
		start[c-'A'] = c;
		c++;
		sleep(2);
	}
	shmdt(start);
	return 0;
}
